package org.aepscolombia.platform.models.entity;
// Generated Apr 8, 2014 9:37:27 AM by Hibernate Tools 3.2.1.GA


import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Municipalities generated by hbm2java
 */
@Entity
@Table(name="municipalities"
    , uniqueConstraints = @UniqueConstraint(columnNames="code_mun") 
)
public class Municipalities  implements java.io.Serializable {


     private Integer idMun;
     private Departments departments;
     private String codeMun;
     private String nameMun;

    public Municipalities() {
    }

    public Municipalities(Integer idMun) {
        this.idMun = idMun;
    }
	
    public Municipalities(Departments departments, String codeMun, String nameMun) {
        this.departments = departments;
        this.codeMun = codeMun;
        this.nameMun = nameMun;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id_mun", unique=true, nullable=false)
    public Integer getIdMun() {
        return this.idMun;
    }
    
    public void setIdMun(Integer idMun) {
        this.idMun = idMun;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="id_department_mun", nullable=false)
    public Departments getDepartments() {
        return this.departments;
    }
    
    public void setDepartments(Departments departments) {
        this.departments = departments;
    }
    
    @Column(name="code_mun", unique=true, nullable=false, length=10)
    public String getCodeMun() {
        return this.codeMun;
    }
    
    public void setCodeMun(String codeMun) {
        this.codeMun = codeMun;
    }
    
    @Column(name="name_mun", nullable=false, length=100)
    public String getNameMun() {
        return this.nameMun;
    }
    
    public void setNameMun(String nameMun) {
        this.nameMun = nameMun;
    }

}


